#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
    int t = 0;
    scanf("%d", &t);
    int rablen = 0;
    int torlen = 0;
    int endtime = 0;
    for (endtime = 1; endtime <= t; endtime++)
    {
        rablen += 9;
        torlen += 3;
        if (endtime % 10 == 0 && rablen > torlen)
        {
            if ((t - endtime) > 30)
            {
                endtime += 30;
                torlen += 90;
            }
            else
            {
                torlen += (t - endtime) * 3;
                break;
            }
        }

    }
    if (rablen > torlen)
    {
        printf("^_^ %d", rablen);
    }
    else if (rablen < torlen)
    {
        printf("@_@ %d", torlen);
    }
    else
    {
        printf("-_- %d", rablen);
    }
    return 0;
}